﻿using ArticleandSiteData;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Xaml.Controls;

namespace Dong
{
    class DataVMClass
    {
        public async Task Getcategorylist(ListView listimg)
        {
            string categoryurl = "https://api.bmob.cn/1/classes/dongimgcategory";
            string result = await RequestHelper.GetHttpstringrequest(categoryurl);
            categorobject m = JsonConvert.DeserializeObject<categorobject>(result);
            listimg.ItemsSource = m.results;

        }
        public async Task Getserieslist(ListView listimg)
        {
            string categoryurl = "https://api.bmob.cn/1/classes/seriesimage";
            string result = await RequestHelper.GetHttpstringrequest(categoryurl);
            seriesimageobject m = JsonConvert.DeserializeObject<seriesimageobject>(result);
            listimg.ItemsSource = m.results;

        }
    }
}
